home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr10 / v12n12.zip / PCMCVT.ZIP / PCMASM.ZIP / PCMDATA.INC < prev    next >
Text File  |  1993-05-29  |  8KB  |  171 lines

  1. ;PCMData.INC
  2. ;Copyright (c) 1993 Jay Munro
  3. ;First published in PC Magazine June 29 1993
  4. ;Data file for PCMCVT.ASM
  5.  
  6. ;---- File Declaration section
  7.  
  8. ParseFileName   Proto Near, FileAddr:Ptr
  9. Seek            Proto Near, Handle1:Word, Pointer:Dword
  10. OpenFile        Proto Near, FileName:Word, Attr:Word
  11. Read            Proto Near, Handle2:Word, Buffer:Word, BufSize:Word
  12. Write           Proto Near, Handle3:Word, Buffer:Word, BufSize:Word
  13. Exist           Proto Near, FileSpec:Word
  14. Close           Proto Near, Handle4:Word
  15. StrCmp          Proto Near, SrcString:Ptr, CmpString:Ptr, StrLength:Word
  16. SearchString    Proto Near, Strt:Word, Srce:Word, SLen:Word, Srch:Word, SrcLen:Word
  17. ShowBuffer      Proto Near, AddrWriteBuffer:Word,BufLen:Word
  18. WordWrap        Proto Near, WBuffer:Word, WBLen:Word
  19. Text2Num        Proto Near, MaxWidthText:Word, MaxWidth:Word
  20. PrintLine       Proto Near, MessagePtr:Word
  21.  
  22. ;---- Data section
  23.  
  24. Copyright       DB 'PCMCVT Version 1.0 ■ Copyright (c) 1993 Jay Munro',10,13
  25.                 DB 'First Published in PC Magazine June 29,1993',10,13,'$'
  26.                 
  27. ;User selection
  28.  
  29. DefExtension    DB  '.TXT',0            ;default extension for dest file
  30. FileType        DW      0               ;file type found
  31.  
  32. ;internal stuff
  33. OldInt24IP      DW      ?               ;old interrupt 24h instruction ptr
  34. OldInt24CS      DW      ?               ; ""  code segment
  35. DOSErrCode      DW      ?              ;save error code
  36. CritErrFlag     DW      ?              ;verify that a critical error occurred
  37. ErrorNum        DW      0              ;error number used for file routines
  38. HelpScreen      DB  10,13
  39.                 DB  'Syntax:',10,13
  40.                 DB  '     PCMCVT  /S source [/D destination] [/Wxx] [/O] [/Tx] [/?] ',10,13
  41.                 DB  10,13
  42.                 DB  '/S  -  Source file: You must specify a source file.',10,13
  43.                 DB  '       File extensions need not match file type but must be included.',10,13
  44.                 DB  '/D  -  Destination file name: the default is the same name as source file',10,13
  45.                 DB  '       but with a .TXT extension.',10,13
  46.                 DB  '       If /O is not specified, you will be warned if file exists.',10,13
  47.                 DB  '/Wxx - Word wrap: forces word wrap at xx line length.',10,13
  48.                 DB  '       Default is 78 characters if just /W specified.',10,13
  49.                 DB  '/O  -  Overwrite destination file if it exists.',10,13
  50.                 DB  '/Tx -  Tab: Sets tab expansion where x is number of spaces to use.',10,13
  51.                 DB  '/?  -  This Help screen',10,13,'$'
  52.  
  53. WordWrapFlag    DB  0
  54. MaxWidthText    DB  10 dup (0)   ;give them some room 
  55. MaxWidth        DW  78
  56. TabWidthText    DB  10 dup (0)   ;give them some room
  57. TabWidth        DW  1
  58. TabFlag         DB  0
  59. CRLF_FLAG       DB  0            ;used in AMI module only
  60. OverWriteFile   DW  0
  61. DTA             DB  66 Dup (?)   ;disk transfer area
  62. TopEnd          DW  0            ;top of input buffer address
  63.  
  64. ;--- word wrap data
  65. LastCRLF        DW  0
  66. CRLF            DB  13,10
  67.  
  68. ;--- misc data
  69. BulletChar      DB  '*'
  70.  
  71. ;--- File data
  72.  
  73. SourceFile      DB  68  Dup (0)  ;buffer for source file
  74. DestFile        DB  70  Dup (0)  ;buffer for destination file
  75.  
  76. SHandle         DW      0       ;file handle for source file
  77. DHandle         DW      0       ;file handle for destination file
  78.  
  79. ReadBuffer      DB  2048 Dup (?) ;read file buffer
  80. BufferSize      DW  2048         ;$ - ReadBuffer
  81.  
  82. WriteBuffer     DB  2048 Dup (?) ;write file buffer
  83. WBufferSize     DW  2048         ;$ - WriteBuffer
  84.  
  85. DestFileThere   DB  0            ;flag for destination file
  86. SourceFileThere DB  0            ;flag for source file
  87.  
  88. HeaderBuffer    DB  256 Dup (0)  ;buffer for header
  89. FilePointer     DD  0            ;current File pointer
  90. EOFFlag         DW  0
  91.  
  92.  
  93. ;--- ID header's data structs
  94. ;--- WordPerfect
  95.  
  96. WPerf51 Struc
  97.   WPCorpID        DB  4 Dup (0)   ;wordperfect id
  98.   WPDocStart      DD  0           ;offset of start of document
  99.   WPProdtype      DB  0           ;product type
  100.   WPFieldtype     DB  0           ;product specific variable
  101.   WPMajorVer      DB  0           ;major of product
  102.   WPMinorVer      DB  0           ;minor version of product (0 for WP5.0,1 for 5.1)
  103.   WPEncryptKey    DW  0           ;0h = not encrypted
  104.   WPReserved      DW  0           ;usually 0h
  105. WPerf51 EndS
  106.  
  107. WPerfID         DB  0FFh,'WPC',0 ;WPerf ID string
  108. InFunction      DB  0             ;flag for in single or multi byte function
  109.  
  110. MSWordDOS Struc
  111.    MSWdwIdent     DW  0BE31H                  ;Signature (magic number)
  112.    MSWddtyDW      DW  0                       ;Document type
  113.    MSWdwTool      DW  0AB00H                  ;Signature
  114.    MSWdpnNextFib  DW  ?                       ;Pointer to incremental save
  115.    MSWdpnChar     DW  ?                       ;Pointer to Char formatting
  116.    MSWdpnPlcpcd   DW  ?                       ;Pointer to piece table
  117.    MSWdfcres      DW  ?                       ;
  118.    MSWdfcMac      DW  ?,?                     ;File char pos of file end
  119.    MSWdpnPara     DW  ?                       ;Location of para formatting
  120.    MSWdpnFntb     DW  ?                       ;Location of footnote table
  121.    MSWdpnBkmk     DW  ?                       ;Bookmarks and sequence info
  122.    MSWdpnSetb     DW  ?                       ;Section table
  123.    MSWdpnBftb     DW  ?                       ;Buffer table
  124.    MSWdpnSumd     DW  ?                       ;Summary information
  125.    MSWdszSsht     DB  66 DUP(?)               ;Style sheet path
  126.    MSWdwReserve   DW  ?                       ;For Windows Write use
  127.    MSWdrgchPrtNm  DB  8  DUP(?)               ;Printer name
  128.    MSWdpnMac      DW  ?                       ;One past end of document
  129.    MSWdDOP        DB  8  DUP(?)               ;Document properties
  130.    MSWdversion    DB  ?                       ;word version
  131.    MSWdfAsv       DB  ?                       ;Autosave
  132.    MSWdpnPagb     DW  ?                       ;Word 5.0 page table
  133.    MSWdpnMacBkmk  DW  ?                       ;Mac of Bkmk stuff
  134.    MSWdpnFilename DW  ?                       ;Only used for Asv files
  135.    MSWdpnRhtb     DW  ?                       ;Running head table
  136.    MSWdcodepage   DW  ?                       ;codepage
  137. MSWordDOS EndS
  138.  
  139. ;signatures (magic numbers)
  140. MSWordDosID           DB     31h,0BEh,0                 ;Word for DOS
  141. MSWordWinID           DB     0DBh,0A5h,0                ;Winword 2
  142. MSWordWinID1          DB     09Bh,0A5h,0                ;Winword 1
  143.  
  144. MSWordWin Struc                                    ;short version
  145.    MSW4wwIdent     DW      0DBA5H             ;Signature (magic number)
  146.    MSW4wnFib       DW      0                  ;fib version written
  147.    MSW4wnProduct   DW      ?                  ;
  148.    MSW4wpnLid      DW      ?                  ;
  149.    MSW4wpnNext     DW      ?                  ;
  150.    MSW4wfComplex   DW      ?                  ;fast saving process
  151.    MSW4wfEncrypt   DW      ?                  ;
  152.    MSW4wfnFibBack  DW      ?,?                ;
  153.    MSW4wrgwspare   DW      ?,?,?              ;reserved
  154.    MSW4wfcMin      DW      ?,?                ;
  155.    MSW4wfcMac      DW      ?                  ;
  156.    MSW4wcbMac      DW      ?                  ;
  157. MSWordWin EndS
  158.  
  159. ;strings used in file
  160. DefaultExtension      DB     '.TXT'
  161. SourceRequired        DB     'You must specify a source file!',10,13,'$'
  162. NotKnown              DB     'Sorry, Unknown format',10,13,'$'
  163. WPerfName             DB     'WordPerfect',10,13,'$'
  164. MSW4DName             DB     'Word For DOS',10,13,'$'
  165. MSW4WName             DB     'Word For Windows 2.0',10,13,'$'
  166. MSW4WName1            DB     'Word For Windows 1.x',10,13,'$'
  167. AMIName               DB     'AMI Pro 2.0',10,13,'$'
  168. WRIName               DB     'Windows Write',10,13,'$'
  169. AMIProID              DB     '[ver]',0
  170. AmiEdoc               DB     '[edoc]',0
  171.